package com.qiche.controller.mgr;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by Linzw on 2018/01/24.
 */
@Controller
public class HomeController {

    @GetMapping("/index")
    public String index() {
        return "index";
    }

    @GetMapping("/register")
    public String register() {
        return "register";
    }

    @GetMapping("/forgetPwd")
    public String forgetPwd() {
        return "forgetPwd";
    }

    /**
     * 控制台页面
     * @return
     */
    @GetMapping("/main")
    public String main() {
        return "main";
    }


    @GetMapping(value = "/login")
    public String login() {
        return "login";
    }

    @GetMapping(value = "/logout")
    public String logout() {
        Subject subject = SecurityUtils.getSubject();
        subject.logout();
        return "login";
    }

    @GetMapping(value = "/wap/login")
    public String wapLogin() {
        return "wap_login";
    }

    @GetMapping(value = "/wap/logout")
    public String waplogout() {
        Subject subject = SecurityUtils.getSubject();
        subject.logout();
        return "wap_login";
    }




    @GetMapping(value = {"/usersPage"})
    public String usersPage() {
        return "user/users";
    }

    @GetMapping(value = {"/clerksPage"})
    public String clerksPage() {
        return "clerk/clerks";
    }

    @GetMapping(value = {"/wap/scancode"})
    public String scancode() {
        return "wap/scancode";
    }

    @GetMapping("/rolesPage")
    public String rolesPage() {
        return "role/roles";
    }

    @GetMapping("/resourcesPage")
    public String resourcesPage() {
        return "resources/resources";
    }

    @GetMapping("/subscribePage")
    public String subscribePage() {
        return "subscribe/subscribes";
    }

    @GetMapping("/servicePage")
    public String subscribeExPage() {
        return "subscribe/services";
    }

    @GetMapping("/merchantsPage")
    public String merchantsPage() {
        return "merchant/merchants";
    }

    @GetMapping("/categorysPage")
    public String categorysPage() {
        return "category/categorys";
    }

    @GetMapping("/productsPage")
    public String productsPage() {
        return "product/products";
    }

    @GetMapping("/packsPage")
    public String packsPage() {
        return "pack/packs";
    }

    @GetMapping("/membersPage")
    public String membersPage() {
        return "member/members";
    }

    @GetMapping("/policysPage")
    public String policysPage() {
        return "policy/policys";
    }

    @RequestMapping("/welfaresPage")
    public String welfaresPage() {
        return "welfare/welfares";
    }

    @RequestMapping("/combosPage")
    public String combosPage() {
        return "combo/combos";
    }
    @RequestMapping("/sysSettingPage")
    public String sysSettingPage() {
        return "sys_setting/setting";
    }

    @RequestMapping("/officialAccountMenuPage")
    public String officialAccountMenuPage() {
        return "menu/menus";
    }
    @RequestMapping("/financePage")
    public String financePage() {
        return "finance/finances";
    }
    @RequestMapping("/agentsPage")
    public String agentsPage() {
        return "agent/agents";
    }
    @RequestMapping("/voucherPackagesPage")
    public String voucherPackagesPage() {
        return "voucher_package/voucher_packages";
    }
    @RequestMapping("/voucherRepositorysPage")
    public String voucherRepositorysPage() {
        return "voucher_repository/voucher_repositorys";
    }
    @RequestMapping("/vouchersPage")
    public String vouchersPage() {
        return "voucher/vouchers";
    }
    @GetMapping("/bannerPage")
    public String bannerPage() {
        return "banner/banners";
    }
    @GetMapping("/prizeDrawPage")
    public String prizeDrawPage() {
        return "prizedraw/prizedraw1";
    }

    @GetMapping("/showCards")
    public String showCards() {
        return "card/cards";
    }

    @GetMapping("/403")
    public String forbidden() {
        return "403";
    }
    @GetMapping("/404")
    public String pageNotFound() {
        return "404";
    }

}
